class Solution:
	# @return a list of lists of integers
	def combine(self, n, k):
		return self.__combine(n, k)

	def __combine(self, n, k):
		if n < k:
			return []
		if n == k:
 			return [range(1, n+1)]
		if n > k:
			if k == 1:
				return [[i] for i in xrange(1, n+1)]
			else:
				base = self.__combine(n-1, k)
				for lin in self.__combine(n-1, k-1):
					lin.append(n)
					base.append(lin)
				return base




if __name__ == '__main__':
	so = Solution()
	print so.combine(5,3)